import Vue from 'vue'
import VueRouter from 'vue-router'
// 导入组件
import login from '@/views/login/login.vue'
import home from '@/views/home/home.vue'
import bussiness from '../views/home/bussiness/bussiness.vue'
import question from '../views/home/question/question.vue'
import find from '../views/home/find/find.vue'
import my from '../views/home/my/my.vue'

Vue.use(VueRouter)

const routes = [
  { path: '/login', component: login },
  { path: '/', redirect: 'login' },
  {
    path: '/home',
    component: home,
    redirect: '/home/my',
    children: [
      { path: '/home/bussiness', component: bussiness },
      { path: '/home/question', component: question },
      { path: '/home/find', component: find },
      { path: '/home/my', component: my }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
